<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        button {
            background-color: blue;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            animation: hover 0.5s ease-in-out infinite;
        }

        @keyframes hover {
            0% {
                background-color: blue;
                color: white;
            }
            50% {
                background-color: red;
                color: black;
            }
            100% {
                background-color: blue;
                color: white;
            }
        }
    </style>
</head>
<body>
<button>Анимированная кнопка</button>
</body>
</html>